# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1BatterySampleReport do
  @moduledoc """
  Sampling data for battery. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDevicePowerStatus](https://chromeenterprise.google/policies/#ReportDevicePowerStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A

  ## Attributes

  *   `chargeRate` (*type:* `integer()`, *default:* `nil`) - Output only. Battery charge percentage.
  *   `current` (*type:* `String.t`, *default:* `nil`) - Output only. Battery current (mA).
  *   `dischargeRate` (*type:* `integer()`, *default:* `nil`) - Output only. The battery discharge rate measured in mW. Positive if the battery is being discharged, negative if it's being charged.
  *   `remainingCapacity` (*type:* `String.t`, *default:* `nil`) - Output only. Battery remaining capacity (mAmpere-hours).
  *   `reportTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp of when the sample was collected on device
  *   `status` (*type:* `String.t`, *default:* `nil`) - Output only. Battery status read from sysfs. Example: Discharging
  *   `temperature` (*type:* `integer()`, *default:* `nil`) - Output only. Temperature in Celsius degrees.
  *   `voltage` (*type:* `String.t`, *default:* `nil`) - Output only. Battery voltage (millivolt).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :chargeRate => integer() | nil,
          :current => String.t() | nil,
          :dischargeRate => integer() | nil,
          :remainingCapacity => String.t() | nil,
          :reportTime => DateTime.t() | nil,
          :status => String.t() | nil,
          :temperature => integer() | nil,
          :voltage => String.t() | nil
        }

  field(:chargeRate)
  field(:current)
  field(:dischargeRate)
  field(:remainingCapacity)
  field(:reportTime, as: DateTime)
  field(:status)
  field(:temperature)
  field(:voltage)
end

defimpl Poison.Decoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1BatterySampleReport do
  def decode(value, options) do
    GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1BatterySampleReport.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1BatterySampleReport do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
